#include<bits/stdc++.h>
using namespace std;
long long n,m,a,b;
int main()
{
	freopen("nim.in","r",stdin);
	freopen("nim.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m>>a>>b;
	for(int i=1;i<n;++i)
		cin>>a>>b;
	cout<<1;
	return 0;
}
